<template>
    <div>
        <div style="display: none" class="permitbutton">
            {{ $props.props_develMaterialItem }}
        </div>
        <div desc="top" style="border-bottom: 1px solid #ddd;padding-bottom: 8px;margin-bottom: 5px;">
            <div style="display: flex;justify-content: space-between;">
                <label>
                    <van-tag size="min" type="danger" style="margin-right: 4px;"
                             v-if="$props?.props_develMaterialItemDtl?.courierType==5">急
                    </van-tag>
                    <dic-tag :value="$props?.props_develMaterialItem?.develType"
                             v-if="$props?.props_develMaterialItem?.develType"
                             style="margin-right:5px;"
                             :code="dic.MesDevelMaterial.mesDevelMaterial_devel_type"></dic-tag>
                </label>
                <label for="">
                    <span style="padding-right: 5px;">{{ $props.props_develMaterialItem?.proCode }}</span>
                    <span style="padding-right: 5px;">{{ $props.props_develMaterialItem?.develNo }}</span>
                    <span style="padding-right: 5px;">{{
                        datemmddhhmm($prop?.props_develMaterialItem?.applyTime)
                        }}</span>
                    <span>{{ $props.props_develMaterialItem?.addUser }}</span>
                </label>

            </div>

        </div>

        <div style="position: relative "    >
            <receiving_materialDltCom
                :props_edit="$props.props_edit"
                                      :props_materialItemDtl="$props.props_develMaterialItemDtl"
                                      :props_materialItem="$props.props_develMaterialItem"
                                      :props_develMaterialCheck="$props.props_develMaterialCheck"
                :props_materialReceivingDtl="$props.props_materialReceivingDtl"
                @updatechange="()=>$emit('updatechange')"
            ></receiving_materialDltCom>
        </div>

    </div>
</template>
<script>
import uploadImagePlus from "@/components/UploadImage/uploadImagePlus.vue";
import inputNumber100 from "@/components/inputNumber/inputNumber100.vue";
import DicTag from "@/components/DicTag/dic-tag.vue";
import {datemmddhhmm} from "../../../utils/dateUtils";
import * as dic from "@/utils/dic";
import {booleanDefault, toFixedInt} from "@/utils";
import receiving_materialDltCom from './receiving_materialDlt.vue'

function getDevelMethod(mmm) {
    var map = {
        1: '本',
        2: '外',
    };
    return map[mmm];
}

export default {
    data() {
        return {
            dic,
            datemmddhhmm,
            getDevelMethod,
            toFixedInt,
            exitZhuansong: booleanDefault(this.$props?.props_develMaterialCheck?.courierMoney > 0, false),
            attachList: [],

        }
    },

    methods: {
        datemmddhhmm
    },
    components: {
        receiving_materialDltCom,
        DicTag,
        inputNumber100,
        uploadImagePlus,
    },
    computed: {

        computed_show_close() {
            if ((typeof this.$props.props_show_close == 'boolean') && !this.$props.props_show_close) {
                return false;
            }
            if (/*编辑是false  不能编辑*/(typeof this.$props.props_edit == 'boolean') && !this.$props.props_edit) {
                console.warn('退出逻辑 不能编辑');
                return false;
            }
            return true;
        },
        computed_show_zhuasong() {
            if (/*编辑是false  不能编辑*/(typeof this.$props.props_edit == 'boolean') && !this.$props.props_edit) {
                console.warn('退出逻辑 不能编辑');
                return false;
            }
            return true;
        },

        computed_disabled_atachlist() {
            if (/*编辑是false  不能编辑*/(typeof this.$props.props_edit == 'boolean') && !this.$props.props_edit) {
                console.warn('退出逻辑 不能编辑');
                return true;
            }
            return false;
        },

    },
    props: {
        props_show_close: {
            type: [Boolean],
            default() {
                return true;
            },
        },
        props_develMaterialItemDtlList: {
            type: [Array],
        },
        props_develMaterialItem: {
            type: [Object],
        },
        props_develMaterialCheck: {
            type: [Object],
        },
        props_materialReceivingDtl: {
            type: [Object],
        },
        props_edit: {
            type: [Boolean],
        },
        props_billingType: {
            type: [String, Number],
        },
        props_develMaterialItemDtl: {
            type: [Object],
        },
    }
}
</script>
